def lw(reg, val):
    a = "10001100000%s%s"
    r = bin(reg)[2:].rjust(5, '0')
    v = bin(val)[2:].rjust(16, '0')
    return a % (r,v)

def convert_mem(file):
    f = open(file, 'r')
    t = f.read().split('\n')
    out = ''
    for line in t:
        if line != '':
            out += '"'
            out += line[:32]
            out += '", --'
            out += line[32:]
            out += '\n'
    return out

a=convert_mem('c:/users/floris/documents/vhdl/mips_dds/tests/final_test.dat')
print(a)
